home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / batch / batmaker.zip / BATMAKER.DOC < prev   
Text File  |  1985-05-12  |  6KB  |  128 lines

  1. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2. BATMAKER                               An MS-DOS Utility by  Robert L. Miller
  3. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  4.  
  5.      The BATMAKER utility is a convenience tool which makes batch files.   The 
  6. idea is based on a CP/M-80 program called FMAP.COM, originally written by Ward 
  7. Christensen,  which I have found useful over the years.   BATMAKER will run on 
  8. ANY  MSDOS  2.x  system,  and  it has a number of  different  output  options, 
  9. tailored to MSDOS.
  10.      BATMAKER  reads  file names from a disk directory and puts them  into  an 
  11. output batch file called NAMES.BAT.   This batch file may then be run like any 
  12. other  batch  file,  using command line arguments to fill in  the  replaceable 
  13. parameter %1, %2, etc.
  14.      The  format  of NAMES.BAT can be any one of a  number  of  possibilities, 
  15. depending  on which option letter is used.   To see how to run it,  just  type 
  16. BATMAKER with no command line arguments:
  17.  
  18. BATMAKER version 2.00 R. L. Miller
  19.  
  20. Usage:  BATMAKER Filename.Typ -0)ption Letter
  21.  
  22. Option Letter  Output
  23. =============  ======
  24.      -A        %1 Filename.Typ %2 %3
  25.      -B        %1 %2 Filename.Typ %3 %4
  26.      -C        %1 %2Filename.Typ %3 %4
  27.      -D        %1 <Filename.Typ >%2 %3
  28.      -E        %1 <Filename.Typ >>%2 %3
  29.      -F        %1 <Filename.Typ |%2 >%3 %4
  30.      -G        %1 <Filename.Typ |%2 >>%3 %4
  31.      -H        -- Prints this help message --
  32.  -any other    Filename.Type
  33.  
  34. Output for all options but -H go to file NAMES.BAT in current directory
  35. Command line can handle paths, e.g.:
  36.                A>BATMAKER B:\BIN\*.COM -A
  37.  
  38.  
  39.      Each  output tupe has different possible uses.   For example,  option  -A 
  40. might be used with the COPY command.  Suppose we did this:
  41.           A>BATMAKER *.COM -A
  42.  
  43.      The  BATMAKER utility would read in all .COM files in the current direct
  44. ory, sort them into alphabetical order, and spit them out into our file called 
  45. NAMES.BAT.  At this point, NAMES.BAT might look like this:
  46.           A> TYPE NAMES.BAT
  47.           %1 TURBO.COM %2 %3
  48.           %1 MAKEBAT.COM %2 %3
  49.           %1 TFLOAT.COM %2 %3
  50.           A>
  51.  
  52.      We could now run NAMES.BAT like this:
  53.           A>NAMES COPY C: -V
  54. and MSDOS would substitute the word "COPY" for replacement parameter  %1, "C:" 
  55. for %2,  and "-V" for %3.  Thus, the screen would show MSDOS doing the follow
  56. ing 3 commands:
  57.           A>COPY TURBO.COM C: -V
  58.           A>COPY MAKEBAT.COM C: -V
  59.           A>COPY TFLOAT.COM C: -V
  60.           A>
  61.  
  62.      (On my system,  I have set the "switch character" to dash ["-"].  On many 
  63. other systems it is a slash ["/"], so those people would make parameter %3 the 
  64. string "/V".)
  65.  
  66.      We  might  think  of MSDOS command lines as sentences which  have  nouns, 
  67. verbs,  and  modifiers.   In  the  example above,  "COPY" acts  like  a  verb, 
  68. "TFLOAT.COM"  acts  like a noun,  and the others are sort of  like  modifiers.  
  69. Most  examples of batch files that you see put the parameters in the positions 
  70. where  the "nouns" could go,  and the "verbs" are explicitly  typed  out.   An 
  71. example of that type could be used to assemble and link programs:
  72.           A> TYPE ASSEMBLE.BAT
  73.           MASM %1,%1,%1,,
  74.           LINK %1,%1,,,
  75.           EXE2BIN %1.EXE %1.COM
  76.           DEL %1.EXE
  77.           A>
  78.  
  79.      NAMES.BAT is just the opposite.  It supplies the "nouns" as explicit file 
  80. names which it gets from a disk directory,  but leaves the variable parameters 
  81. as place markers for the verbs you will fill in later when you use it.
  82.  
  83.      We still have our copy of NAMES.BAT on drive A, so we can use it again:
  84.           A>NAMES DEL
  85. which causes MSDOS to do this:
  86.           A>DEL TURBO.COM
  87.           A>DEL MAKEBAT.COM
  88.           A>DEL TFLOAT.COM
  89.           A>
  90.  
  91.      This  is just a reminder to show you that,  if you don't supply all  the 
  92. parameters  in the command line,  MSDOS just puts blanks where the  unsupplied 
  93. parameters would go.
  94.  
  95.      I have tried to supply a lot of options for the format of NAMES.BAT.   In 
  96. addition  to sticking several parameters at the end of the line, which you may 
  97. or  may not use,  I have included options which do  input/output  redirection, 
  98. appending to a file, and piping.
  99.  
  100.      Frankly,  though, I'm not sure if I supplied ENOUGH options, or the RIGHT 
  101. KIND of options.   If there's a useful option I have left out,  I'd appreciate 
  102. hearing from you, even if you add it yourself.
  103.  
  104.      I  am  releasing  the executable file and the source code to  the  public 
  105. domain.   The program is written in Turbo Pascal,  version 2.2.   There is one 
  106. catch,  however.  The directory sort uses routines in the Turbo Toolbox, which 
  107. I cannot give out.   Therefore,  you must also have Turbo Toolbox in order  to 
  108. recompile BATMAKER.
  109.  
  110.                     Robert L. Miller
  111.                     908 N. Broadway, #411
  112.                     Urbana, Il 61801
  113.                     (217) 367-0044 eves.
  114.  
  115.  
  116. P.S.:
  117.  
  118.     Depending on the type of video display you use, you may notice a few
  119. "junk characters" at the very beginning of the signon message.  For some reason,
  120. Turbo Pascal insists on sending an Esc p,Esc q sequence to the console at the 
  121. very beginning of the run of any program I compile.  I have a Heath H19 terminal,
  122. and this sequence would tell the terminal to get into and then immediately out
  123. of inverse video (highlighting) mode.  I have tried re-installing Turbo Pascal,
  124. to make sure it isn't trying to send a terminal initialization string at the
  125. beginning of a program.  As far as I can tell, this is a bug in Turbo.
  126.     This should have no effect on the operation of BATMAKER, unless these
  127. escape sequences do something undesirable to your terminal display.
  128.